from django.db import models
from Base.Time_Base import Create_Time_Base




# 班组
class Team(Create_Time_Base):
    team_name = models.CharField('班组名称',max_length=64,default='')
    manager = models.CharField('经理',max_length=64,default='')
    allocation = models.CharField('呼叫分配模式',max_length=11,choices=(('1','轮选'),('2','最少'),('3','随机'),('4','坐席级别'),('5','空闲时长')),default='1')
    account_id = models.CharField('所属企业id',max_length=32,default='')
    status = models.CharField('状态',max_length=11,choices=(('0','正常'),('1','删除')),default='0')
    class Meta:
        db_table = 'zb_team'

    def __str__(self):
        return self.team_name

# 坐席
class Seats(Create_Time_Base):
    job_number = models.CharField('工号',max_length=64,default='')
    staff_name = models.CharField('员工姓名',max_length=32,default='')
    login_pwd = models.CharField('登录密码',max_length=255,default='')
    organizing_time = models.CharField('整理时间',max_length=11,default='0')
    is_record = models.CharField('是否录音',max_length=11,choices=(('0','是'),('1','否')),default='0')
    is_play_screen = models.CharField('是否弹屏',max_length=11,choices=(('0','是'),('1','否')),default='0')
    status = models.CharField('状态',max_length=11,choices=(('0','启用'),('1','禁用')),default='0')
    extension_number_id = models.CharField('分机号外键',max_length=32,default='')
    rank = models.CharField('坐席级别',max_length=11,default='A')
    team_id = models.CharField('班组外键',max_length=11,default='')

    class Meta:
        db_table = 'zb_seats'

    def __str__(self):
        return self.job_number

# 坐席状态
class Seats_Status(Create_Time_Base):

    seats_number = models.CharField('坐席号',max_length=64,default='')
    status = models.CharField('坐席状态',max_length=32,default='0')
    free_time = models.CharField('总时长',max_length=64,default='')
    account_name = models.CharField('企业名称',max_length=64,default='')
    account_tag = models.CharField('企业标识',max_length=64,default='')

    class Meta:
        db_table = 'zb_seats_status'

    def __str__(self):
        return self.seats_number
